package com.ss.android.pay;

import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import java.lang.ref.WeakReference;

final class b extends e {
    Handler a;
    WeakReference b;

    b(Activity arg3, h arg4, j arg5) {
        super(arg4, arg5);
        this.a = new c(this, Looper.getMainLooper());
        this.b = new WeakReference(arg3);
    }

    private static String a(String arg2, String arg3, String arg4) {
        int v0 = arg2.indexOf(arg3) + arg3.length();
        try {
            arg2 = arg2.substring(v0, arg2.indexOf(arg4, v0));
        }
        catch(Exception v0_1) {
            v0_1.printStackTrace();
        }

        return arg2;
    }

    protected final void a() {
        new d(this).start();
    }

    protected final void a(String arg4, j arg5) {
        String v1 = b(arg4);
        int v0 = -2;
        if(!TextUtils.isEmpty(((CharSequence)v1))) {
            if("6001".equals(v1)) {
                v0 = -1;
            }
            else if("9000".equals(v1)) {
                v0 = 0;
            }
        }

        arg5.a(v0, v1);
    }

    private static String b(String arg2) {
        String v0_1;
        try {
            v0_1 = a(arg2, "resultStatus={", "}");
        }
        catch(Throwable v0) {
            v0_1 = "";
        }

        return v0_1;
    }
}

